package com.dfrz.ch06.tackTeacher;

import java.util.Scanner;

/**
 * 作者：wangmaokang
 * 日期: 2021/4/14 9:34
 * 描述:
 */
public class ExString08_01 {

    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入母字符串");
        String str1 = sc.nextLine();
        System.out.println("请输入子字符串");
        String str2 = sc.nextLine();

        while (str1.contains(str2)){   //判断字符串是否包含另一个字符串
          str1=  str1.replaceAll(str2,"");
            System.out.println("删除子字符串后：\n"+str1);
        }



    }
}
